// To parse this JSON data, do
//
//     final userEntity = userEntityFromMap(jsonString);
import 'package:floor/floor.dart';
import 'package:json_annotation/json_annotation.dart';

part 'friend_info_db.g.dart';

@Entity(tableName: 'FriendList')
@JsonSerializable()
class FriendInfoDb {
  @JsonKey(name: "remark")
  String? remark;
  @JsonKey(name: "relation_status")
  int? relationStatus;

  ///1正常，2特别关注，3不看他，4不让他看我
  @JsonKey(name: "is_star")
  bool? isStar;
  @JsonKey(name: "is_top")
  bool? isTop;
  @JsonKey(name: "add_at")
  String? addAt;
  @JsonKey(name: "block_reason")
  String? blockReason;
  @JsonKey(name: "is_blocked")
  bool? isBlocked;
  @JsonKey(name: "request_type")
  int? requestType;
  @JsonKey(name: "request_source")
  int? requestSource;

  @JsonKey(name: "user_phone")
  String? userPhone;
  @JsonKey(name: "user_nick")
  String? userNick;
  @JsonKey(name: "user_avatar")
  String? userAvatar;
  @JsonKey(name: "user_role_type")
  int? userRoleType;
  @JsonKey(name: "user_sex")
  int? userSex;
  @JsonKey(name: "user_birth")
  String? userBirth;
  @JsonKey(name: "user_email")
  String? userEmail;
  @JsonKey(name: "user_region")
  int? userRegion;
  @PrimaryKey()
  @JsonKey(name: "user_id")
  String? userID;
  @JsonKey(name: "user_signature")
  String? userSignature;
  @JsonKey(name: "user_status")
  int? userStatus;
  @JsonKey(name: "label_list")
  String? labelList;

  FriendInfoDb({
    this.remark,
    this.relationStatus,
    this.isStar,
    this.isTop,
    this.addAt,
    this.blockReason,
    this.isBlocked,
    this.userPhone,
    this.userNick,
    this.userAvatar,
    this.userRoleType,
    this.userSex,
    this.userBirth,
    this.userEmail,
    this.userRegion,
    this.userID,
    this.userSignature,
    this.userStatus,
    this.requestType,
    this.requestSource,
    this.labelList,
  });

  FriendInfoDb copyWith({
    String? remark,
    int? relationStatus,
    bool? isStar,
    bool? isTop,
    String? addAt,
    String? blockReason,
    bool? isBlocked,
    String? userPhone,
    String? userNick,
    String? userAvatar,
    int? userRoleType,
    int? userSex,
    String? userBirth,
    String? userEmail,
    int? userRegion,
    String? userID,
    String? userSignature,
    int? userStatus,
    int? requestType,
    int? requestSource,
    String? labelList,
  }) =>
      FriendInfoDb(
        remark: remark ?? this.remark,
        relationStatus: relationStatus ?? this.relationStatus,
        isStar: isStar ?? this.isStar,
        isTop: isTop ?? this.isTop,
        addAt: addAt ?? this.addAt,
        blockReason: blockReason ?? this.blockReason,
        isBlocked: isBlocked ?? this.isBlocked,
        userPhone: userPhone ?? this.userPhone,
        userNick: userNick ?? this.userNick,
        userAvatar: userAvatar ?? this.userAvatar,
        userRoleType: userRoleType ?? this.userRoleType,
        userSex: userSex ?? this.userSex,
        userBirth: userBirth ?? this.userBirth,
        userEmail: userEmail ?? this.userEmail,
        userRegion: userRegion ?? this.userRegion,
        userID: userID ?? this.userID,
        userSignature: userSignature ?? this.userSignature,
        userStatus: userStatus ?? this.userStatus,
        requestType: requestType ?? this.requestType,
        requestSource: requestSource ?? this.requestSource,
        labelList: labelList ?? this.labelList,
      );

  factory FriendInfoDb.fromJson(Map<String, dynamic> json) => _$FriendInfoDbFromJson(json);

  Map<String, dynamic> toJson() => _$FriendInfoDbToJson(this);
}
